﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HuiZe.education.Resource.Controls.VideoPlay
{
    public static class Model
    {
        /// <summary>
        /// 工程信息
        /// </summary>
        public class Project
        {
            public Project()
            { 
                ProjectName = string.Empty;
                EntrustUnit= string.Empty;
                TaskNo = string.Empty;
                ProjSite = string.Empty;
                DetectionItem = string.Empty;
                DetStartDate = DateTime.Now.ToString();
                DetEndDate = DateTime.Now.ToString();
                List_Tubulation = new List<Tubulation>();
                List_DeviceMan = new List<DeviceMan>();
                DetWay =string.Empty;
                Weather = string.Empty;
                TestAccord = string.Empty;
                ViewStaus = false;
            }
            /// <summary>
            /// 工程名称
            /// </summary>
            public string ProjectName { get; set; }
            /// <summary>
            /// 委托单位
            /// </summary>
            public string EntrustUnit { get; set; } 
            /// <summary>
            /// 任务编号
            /// </summary>
            public string TaskNo { get; set; }
            /// <summary>
            /// 工作地点
            /// </summary>
            public string ProjSite { get; set; }
            /// <summary>
            /// 检测项目
            /// </summary>
            public string DetectionItem { get; set; }
            /// <summary>
            /// 检测起始日期
            /// </summary>
            public string DetStartDate { get; set; }
            /// <summary>
            /// 检测终止日期
            /// </summary>
            public string DetEndDate { get; set; }
            /// <summary>
            /// 管段列表
            /// </summary>
            public List<Tubulation> List_Tubulation { get; set; }
            /// <summary>
            /// 设备管理
            /// </summary>
            public List<DeviceMan> List_DeviceMan { get; set; }
            /// <summary>
            /// 检测方法
            /// </summary>
            public string DetWay { get; set; }
            /// <summary>
            /// 天气
            /// </summary>
            public string Weather { get; set; }
            /// <summary>
            /// 测试依据
            /// </summary>
            public string TestAccord { get; set; }
            /// <summary>
            /// 视图状态(false为缺陷管理视图,true为缺陷查看视图)
            /// </summary>
            public bool ViewStaus { get; set; }
        } 
        /// <summary>
        /// 管段信息
        /// </summary>
        public class Tubulation
        {
            public Tubulation()
            {
                TubulationNo = string.Empty;
                DetDate = DateTime.Now;
                Pipe ="";
                Mete = string.Empty;
                StartPoint = string.Empty;
                EndPoint= string.Empty;
                TubLen = 0;
                DetLen = 0;
                StartDeep = string.Empty;
                EndDeep = string.Empty;
                DetDir = string.Empty;
                TubDescribe = string.Empty;
                Normal = false;
                TubStaus = TubStaus.新添加的管段;
                List_VideoInfo = new List<VideoInfo>();
                List_MalfInfo = new List<MalfInfo>();
                
            }
            /// <summary>
            /// 管段描述
            /// </summary>
            public string TubDescribe { get; set; }
            /// <summary>
            /// 管段编号
            /// </summary>
            public string TubulationNo { get; set; }
            /// <summary>
            /// 检测日期
            /// </summary>
            public DateTime DetDate { get; set; }
            /// <summary>
            /// 管材
            /// </summary>
            public string Mete { get; set; }
            /// <summary>
            /// 管径
            /// </summary>
            public string Pipe { get; set; }
            /// <summary>
            /// 管段起点
            /// </summary>
            public string StartPoint { get; set; }
            /// <summary>
            /// 管段终点
            /// </summary>
            public string EndPoint { get; set; } 
            /// <summary>
            /// 管段长度
            /// </summary>
            public decimal TubLen { get; set; } 
            /// <summary>
            /// 检测长度
            /// </summary>
            public decimal DetLen { get; set; }
            /// <summary>
            /// 起点埋深
            /// </summary>
            public string StartDeep { get; set; }
            /// <summary>
            /// 终点埋深
            /// </summary>
            public string EndDeep { get; set; }
            /// <summary>
            /// 检测方法
            /// </summary>
            public string DetMet { get; set; }
            /// <summary>
            /// 检测地点
            /// </summary>
            public string DetAddr{ get; set; }
            /// <summary>
            /// 管段类型
            /// </summary>
            public string TubType { get; set; }
            /// <summary>
            /// 检测方向
            /// </summary>
            public string DetDir { get; set; }
            /// <summary>
            /// 管段正常
            /// </summary>
            public bool Normal { get; set; }
            /// <summary>
            /// 管段位置
            /// </summary>
            public int  MalfLocation { get; set; }
            /// <summary>
            /// 检测视频列表
            /// </summary>
            public List<VideoInfo> List_VideoInfo { get; set; }
            /// <summary>
            /// 缺陷记录列表
            /// </summary>
            public List<MalfInfo> List_MalfInfo { get; set; }
            /// <summary>
            /// 管段记录状态
            /// </summary>
            public TubStaus TubStaus { get; set; }
        }
        public enum PlayState
        {
            播放 = 0,
            暂停 = 1,
            停止 = 2

        }
        /// <summary>
        /// 检测视频
        /// </summary>
        public class VideoInfo
        {
            /// <summary>
            /// 视频名称
            /// </summary>
            public string VideoName { get; set; } 
        }
        /// <summary>
        /// 缺陷信息
        /// </summary>
        public class MalfInfo
        {
            public MalfInfo()
            {
                MalfId = clsPubic.GetCurrentTimeUnix().ToString();
            }
            /// <summary>
            /// 缺陷名称
            /// </summary>
            public string MalfName { get; set; }
            /// <summary>
            /// 缺陷等级
            /// </summary>
            public int Level { get; set; } 
            /// <summary>
            /// 时钟表示
            /// </summary>
            public string TimeShow { get; set; }
            /// <summary>
            /// 缺陷起点
            /// </summary>
            public decimal MalfStart { get; set; }
            /// <summary>
            /// 缺陷终点
            /// </summary>
            public decimal MalfEnd { get; set; }
          
            /// <summary>
            /// 是否为反向检测
            /// </summary>
            public bool IsDetRev { get; set; }
            /// <summary>
            /// 分值
            /// </summary>
            public decimal MalfScore { get; set; }
            /// <summary>
            /// 缺陷描述
            /// </summary>
            public string Describe { get; set; }
            /// <summary>
            /// 视频开始播放时间
            /// </summary>
            public string StartTime { get; set; }
            /// <summary>
            /// 视频终止播放时间
            /// </summary>
            public string EndTime { get; set; } 
            /// <summary>
            /// 缺陷截屏文件名
            /// </summary>
            public string ImageName { get; set; } 
            /// <summary>
            /// 视频名称
            /// </summary>
            public string VideoName { get; set; }
            /// <summary>
            /// 记录时间
            /// </summary>
            public string MalfId { get; set; }
            /// <summary>
            /// 缺陷类型
            /// </summary>
            public MalfType MalfType { get; set; }
        }
        public enum FormStyle
        {
            新建=0,
            编辑=1
        }
        public enum MalfType
        {
            结构性缺陷=0,
            功能性缺陷=1,
            正常
        }
        public enum TubStaus
        {
            新添加的管段 = 0,
            检测中的管段 = 1,
            完成的管段 = 2
        }
        /// <summary>
        /// 当前操作
        /// </summary>
        public enum CurrentOperate
        {
            标记缺陷 = 0,
            取消标记 = 1,
            保存标记=2,
            管段正常 = 3,
        }
        public class MalfDesSys
        {
            /// <summary>
            /// 缺陷名称
            /// </summary>
            public string MalfName { get; set; }
            /// <summary>
            /// 配置队列
            /// </summary>
            public List<MalfDesAndLevelAndScore> List_MalfAss = new List<MalfDesAndLevelAndScore>();
        }
        /// <summary>
        /// 缺陷配置表
        /// </summary>
        public class MalfDesAndLevelAndScore
        {
            /// <summary>
            /// 缺陷等级
            /// </summary>
            public int Level { get; set; }
            /// <summary>
            /// 分值
            /// </summary>
            public decimal MalfScore { get; set; }
            /// <summary>
            /// 缺陷描述
            /// </summary>
            public string Describe { get; set; }
        }
        /// <summary>
        /// 设备管理
        /// </summary>
        public class DeviceMan
        {
            /// <summary>
            /// 设备编号
            /// </summary>
            public string DeviceNo { get; set; }
            /// <summary>
            /// 管理编号
            /// </summary>
            public string ManageNo { get; set; }
        }
        public class TubGroup
        {
            public TubGroup()
            {
                List_Tub = new List<Tubulation>();
            }
            public string GroupName { get; set; }
            public List<Tubulation> List_Tub { get; set; }
        }
    }
}
